Skip to content

feat: accept agreement proposals from senders with escrow#1049

Draft
MoonBoi9001 wants to merge 2 commits into
main-dips-rebasedfrom
mb9/check-escrow-for-untrusted-agreement-senders
Draft

feat: accept agreement proposals from senders with escrow#1049
MoonBoi9001 wants to merge 2 commits into
main-dips-rebasedfrom
mb9/check-escrow-for-untrusted-agreement-senders

Conversation

@MoonBoi9001

@MoonBoi9001 MoonBoi9001 commented Jun 9, 2026

Copy link
Copy Markdown
Member

TL;DR

Today the indexer only accepts indexing-agreement proposals whose sender holds an on-chain manager role; everyone else is turned away. This adds a fallback that admits a sender when the account behind its signature already holds enough escrow (default 1 GRT) in the query-fee escrow the service watches. The role path is unchanged — this only widens who is allowed to propose.

Motivation

When an indexer receives an indexing-agreement proposal, it recovers who signed it and checks that signer against the set of accounts granted the on-chain agreement-manager role. That gate is right for the managed flow, but it shuts out a legitimate, already-funded payer who was never granted the role. Without an alternative, those proposals are rejected before any pricing or manifest checks run, and the only way to onboard such a payer is to hand out the manager role.

This adds a second, permissionless route: if the recovered signer resolves to an account holding escrow at or above a configured floor, the proposal proceeds to the normal pricing and manifest checks. The balance consulted is the query-fee (TAP) escrow the indexer already watches — so it is evidence the sender is a real, funded participant, not a guarantee the recurring agreement itself will be paid — and the role check still runs first, leaving managed senders unaffected.

Summary

  • Admit a sender the role gate rejects when its recovered signer holds escrow at or above a minimum.
  • Check escrow against the recovered signer, never the proposal's caller-supplied payer field.
  • Reuse the query-fee (TAP) escrow snapshot the service already watches; no extra subgraph query.
  • Treat that balance as an admission signal the sender is funded, not proof the agreement is paid.
  • Add a configurable minimum balance (default 1 GRT), with a TODO to later derive it from price.
  • Treat an empty escrow snapshot as transient so a funded sender is not rejected during an outage.
  • Reject an underfunded or unknown sender with a dedicated insufficient-escrow reason.

@graphprotocol graphprotocol deleted a comment from github-actions Bot Jun 12, 2026
@MoonBoi9001
MoonBoi9001 force-pushed the mb9/check-escrow-for-untrusted-agreement-senders branch from 860d124 to e6a7841 Compare June 12, 2026 09:43
@MoonBoi9001
MoonBoi9001 requested a review from RembrandtK June 12, 2026 10:31
@MoonBoi9001
MoonBoi9001 marked this pull request as ready for review June 12, 2026 10:31

@RembrandtK RembrandtK left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are query-fee and indexing-payment escrows being conflated here? I might be missing something, but it looks like the snapshot we're reading is scoped to the query-fee collector (receipts_verifier_address_v2), whereas DIPs agreements settle through the RecurringCollector. Escrow is keyed on (payer, collector, receiver), so a balance on the query-fee escrow tells us nothing abouth the Recurring Collector one?

I'm also concerned about the flat 1 GRT floor. The meaningful threshold should be based on possible future claim(s) rather than a fixed amount?

Do we even need this now? We agreed not to require this for Recurring Agreement Manager, which is the only immediate use case?

Base automatically changed from mb9/trust-dips-senders-by-onchain-manager-role to main-dips-rebased June 15, 2026 06:43
MoonBoi9001 and others added 2 commits June 15, 2026 22:16
Senders that hold no on-chain agreement-manager role were rejected outright. This admits
one when its recovered signer resolves to escrow at or above a configurable minimum
(default 1 GRT); an empty snapshot is transient so a funded sender isn't branded unfunded.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
The escrow-floor tunable that admits non-manager senders had no entry in the example config, so operators couldn't discover it. Document it, and explain why the value is stored as GRT in config but compared as U256 wei (escrow balances arrive as U256 wei).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@MoonBoi9001
MoonBoi9001 force-pushed the mb9/check-escrow-for-untrusted-agreement-senders branch from 7237105 to 9b21ccc Compare June 15, 2026 10:27
@MoonBoi9001

Copy link
Copy Markdown
Member Author

I'm also concerned about the flat 1 GRT floor. The meaningful threshold should be based on possible future claim(s) rather than a fixed amount?

I was planning to defer that to a follow up, but just get the ball rolling in this PR with a 1 GRT floor.

Do we even need this now? We agreed not to require this for Recurring Agreement Manager, which is the only immediate use case?

We can close for now, I think this was a reasonable base to build out a more permissionless system from, and a natural extension of the PR sequence from #1045 > #1048 > #1049, but agreed that it's not strictly necessary atm.

Are query-fee and indexing-payment escrows being conflated here? I might be missing something, but it looks like the snapshot we're reading is scoped to the query-fee collector (receipts_verifier_address_v2), whereas DIPs agreements settle through the RecurringCollector. Escrow is keyed on (payer, collector, receiver), so a balance on the query-fee escrow tells us nothing abouth the Recurring Collector one?

Yes this needs addressing when reopened/revisited, nice catch.

@MoonBoi9001 MoonBoi9001 reopened this Jun 19, 2026
@MoonBoi9001
MoonBoi9001 marked this pull request as draft June 19, 2026 06:48
@MoonBoi9001

Copy link
Copy Markdown
Member Author

Reopened as draft, pending refactor, so this doesnt get lost in the noise

@MoonBoi9001 MoonBoi9001 added the DIPs Decentralized Indexing Payments label Jun 22, 2026
@MoonBoi9001 MoonBoi9001 added the low label Jul 8, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

DIPs Decentralized Indexing Payments low

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants